import {Component} from "react";
import ForceRenderItem from "./ForceRenderItem"

class App extends Component {
    state = {
        mssg: false,
        test: "test",
        manualForceRender: false
    };

    handleClick = () => {
        this.setState({
            ...this.state,
            mssg: !this.state.mssg
        });
    };
    handleForceRender = () => {
        this.forceUpdate();
    };

    manualForceRender = () => {
        this.setState({

            manualForceRender: !this.state.manualForceRender
        });
    };

    render() {
        console.log("render() method",this.state);
        return (
            <>
                <hr/>
                <button onClick={this.handleClick}>change state</button>
                <hr/>
                <button onClick={this.handleForceRender}>handleForceRender</button>
                <hr/>
                <button onClick={this.manualForceRender}>changemanualForceRender</button>
               {/*<ForceRenderItem  manualForceRender={this.state.manualForceRender}></ForceRenderItem>*/}
                {/*<div>{this.state.mssg}</div>*/}
            </>
        );
    }
}

export default App;
